Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set bypass executionpolicy when calling PowerShell #715

Merged
merged 2 commits into from
Apr 4, 2025

Conversation

SteveL-MSFT
Copy link
Member

PR Summary

Windows Client machines have restricted execution policy by default, so that doesn't allow scripts (signed or not) to run which cases the PowerShell adapter to fail unless the user explicitly changes their execution policy. Instead, since DSC already sets the working directory to the location of the resource manifest, we can be assured that the intended adapter script gets run. Fix is to explicitly set execution policy to bypass, which won't override Group Policy.

PR Context

Fix #714

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Apr 4, 2025
Merged via the queue into PowerShell:main with commit 82295d4 Apr 4, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the executionpolicy branch April 4, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dsc resource list with --adapter flag returns with Exit code 1
2 participants